/**
 * @fileoverview   anim/base  Anim类定义模块，
 * Created by fu.
 * Date: 12-2-8
 * Time: 下午4:41
 */
F.reg('anim/base',function(f,dom){
    var win = window,doc = win['document'],docElement = doc.documentElement;
    /**
     * @name F.Anim
     * @object
     * @namespace Anim模块、使用new初始化一个元素，再run()
     *
     */
    function Anim(sel){
        this.elem=dom.query(sel);
        this.queue=[];
        this.isend=true;
        this.timeID=0;
        this.curopt=null;
        this.curtime=0;
        this.laststyle={};

    }

    /**
     * @name F.Anim.tween
     * @object
     * @namespace Anim缓动模块，直接使用参数，或是扩展缓动、 <br>
     * 默认提供2种： linear,easeInOutQuad <br>
     * 若加载了easing模块，则支持以下缓动：<br>
     * //二次方缓动
     * easeInQuad     <br>
     * easeOutQuad   <br>
     * easeInOutQuad   <br>
     * //三次方缓动   <br>
     * easeInCubic   <br>
     * easeOutCubic   <br>
     * easeInOutCubic   <br>
     * //四次方缓动   <br>
     * easeInQuart   <br>
     * easeOutQuart   <br>
     * easeInOutQuart   <br>
     * //五次方缓动   <br>
     * easeInQuint   <br>
     * easeOutQuint   <br>
     * easeInOutQuint   <br>
     * //正弦曲线缓动   <br>
     * easeInSine   <br>
     * easeOutSine   <br>
     * easeInOutSine   <br>
     * //指数曲线缓动   <br>
     * easeInExpo   <br>
     * easeOutExpo   <br>
     * easeInOutExpo   <br>
     * //圆形曲线的缓动   <br>
     * easeInCirc   <br>
     * easeOutCirc   <br>
     * easeInOutCirc   <br>
     * //指数衰减的正弦曲线缓动   <br>
     * easeInElastic   <br>
     * easeOutElastic   <br>
     * easeInOutElastic   <br>
     * //超过范围的三次方缓动   <br>
     * easeInBack   <br>
     * easeOutBack   <br>
     * easeInOutBack   <br>
     * //指数衰减的反弹缓动   <br>
     * easeInBounce   <br>
     * easeOutBounce   <br>
     * easeInOutBounce   <br>
     * @example
     * 例子：
     * 1.
     * new anim('a').run({left:100,'easeInOutQuad'}
     */

    Anim.tween={
        linear:function( t, b, c, d){
            return t*c/d + b;
        },
        easeInOutQuad: function(t,b,c,d){

           return c*(t/=d)*t + b;

         }
    };



    return Anim;
},{
    requires:[
        'dom'
    ]
});
